#include<stdio.h>

char sieve[1001];

void makesieve() {
	int i, j;
	sieve[0] = 0;
	for (i = 1; i <= 1000; sieve[i++] =1);
	for (i = 2; i <= 1000; i++) 
		if (sieve[i])
			for (j = i + i; j <= 1000; j += i) sieve[j] = 0;
}

int main() {
	int primelist, centerlist, num, c, init;
	makesieve();
	while (scanf("%d %d", &primelist, &centerlist) == 2) {
		num = 0;
		printf("%d %d:", primelist, centerlist);
		for (c = 1; c <= primelist; c++) if (sieve[c]) num++;

		if (centerlist + centerlist > num) {
			for (c = 1; c <= primelist; c++) 
				if (sieve[c]) printf(" %d", c);
	 	} else {
			if (num & 1) {
				num = (num + 1) / 2 - centerlist + 1;
				init = 0;
				for (c = 0; c < num - 1;) {
					if (sieve[init]) c++;
					init++;
				}
				for (c = 0; c < 2 * centerlist - 1;) {
					if (sieve[init]) {
						printf(" %d", init);
						c++;
					}
					init++;
				}
			} else {
				num = num / 2 - centerlist;
				init = 0;
				for (c = 0; c < num;) {
					if (sieve[init]) c++;
					init++;
				}
				for (c = 0; c < 2 * centerlist;) {
					if (sieve[init]) {
						printf(" %d", init);
						c++;
					}
					init++;
				}
			}
		} printf("\n\n");
	}
}
